#pragma once

namespace my_reverse_iterator
{
	template<class iterator ,class Ref,class Ptr>

	struct Reverse_Iterator
	{
		typedef Reverse_Iterator<iterator, Ref, Ptr> self;

		iterator _it;
	
		Reverse_Iterator(iterator it)
			:_it(it)
		{}

		Ref operator* ()
		{
			iterator tmp(_it);
			return *(--tmp);
		}

		Ptr operator->()
		{
			return &(operator* ());
		}

		self& operator++()
		{
			--_it;
			return *this;
		}
		self& operator--()
		{
			++_it;
			return *this;
		}

		bool operator==(const self& s)const
		{
			return _it == s._it;
		}

		bool operator!=(const self& s)const
		{
			return _it != s._it;
		}
	
		
	};
}
